package cn.enilu.flash.bean.entity.house;

import cn.enilu.flash.bean.entity.BaseEntity;
import lombok.Data;
import org.hibernate.annotations.Table;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @Description
 * @Author Spark
 * @Date Created in (2019/10/30 15:48)
 * @Version v1.0
 * @Modify
 **/
@Entity(name="repair_info")
@Table(appliesTo = "repair_info",comment = "报修")
@Data
@EntityListeners(AuditingEntityListener.class)
public class RepairInfo extends BaseEntity {
    @Column(name = "community_id", columnDefinition = "BIGINT COMMENT '社区ID'")
    @NotNull(message = "社区未关联")
    private Long communityId;

    @Column(name = "building_id", columnDefinition = "BIGINT COMMENT '大楼ID'")
    @NotNull(message = "大楼未关联")
    private Long buildingId;

    @Column(name = "room_id", columnDefinition = "BIGINT COMMENT '房间ID'")
    @NotNull(message = "房间未关联")
    private Long roomId;

    @Column(name = "code", columnDefinition = "VARCHAR(32) COMMENT '工单号'")
    @NotNull(message = "工单号不能为空")
    private String code;

    @Column(name = "cust_id", columnDefinition = "BIGINT COMMENT '客户ID'")
    @NotNull(message = "客户ID不能为空")
    private Long custId;

    @Column(name = "apply_name", columnDefinition = "VARCHAR(64) COMMENT '报修人'")
    @NotNull(message = "报修人不能为空")
    private String applyName;

    @Column(name = "apply_mobile", columnDefinition = "VARCHAR(20) COMMENT '联系电话'")
    @NotNull(message = "联系电话不能为空")
    private String applyMobile;

    @Column(name = "apply_type", columnDefinition = "INT COMMENT '报修类型'")
    @NotNull(message = "报修类型不能为空")
    private Integer applyType;

    @Column(name = "apply_content", columnDefinition = "VARCHAR(1024) COMMENT '报修描述'")
    private String applyContent;

    @Column(name = "state", columnDefinition = "INT COMMENT '报修状态'")
    @NotNull(message = "报修状态不能为空")
    private Integer state;

    @Column(name = "execute_user_id", columnDefinition = "BIGINT COMMENT '处理人ID'")
    @NotNull(message = "处理人ID不能为空")
    private Long executeUserId = 0L;

    @Column(name = "execute_time", columnDefinition = "DATETIME COMMENT '处理时间'")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date execute_time;

    @Column(name = "execute_content", columnDefinition = "VARCHAR(1024) COMMENT '处理内容描述'")
    private String executeContent;

    @Column(name = "fee_amt", columnDefinition = "DOUBLE(8,2) COMMENT '费用'")
    private Double feeAmt;

    @Column(name = "fee_state", columnDefinition = "INT COMMENT '缴费状态'")
    @NotNull(message = "缴费状态不能为空")
    private Integer feeState = 2;

    @Column(name = "pay_time", columnDefinition = "DATETIME COMMENT '缴费时间'")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date payTime;

    @Column(name = "pay_id", columnDefinition = "BIGINT COMMENT '缴费记录ID'")
    @NotNull(message = "缴费记录ID不能为空")
    private Long payId = 0L;

    @Column(name = "ev", columnDefinition = "INT COMMENT '评分'")
    private Integer ev;

    @Column(name = "em", columnDefinition = "VARCHAR(1024) COMMENT '评论'")
    private Integer em;
}
